');$el.appendTo($('body'));for (var i = envs.length - 1; i >= 0; i--) {var env = envs[i];$el.addClass('hidden-'+env);if ($el.is(':hidden')) {$el.remove();return env;}}}
function findBootstrapColPerRow( $sectionItemsContainer ) {let container_width = $sectionItemsContainer.width();let item_width = $sectionItemsContainer.children().first().width();let slidesToShow = Math.floor(container_width / item_width);let item_spacing = parseInt($sectionItemsContainer.css('gap'));$sectionItemsContainer.children().css({paddingLeft : item_spacing / 2,paddingRight : item_spacing / 2})
return slidesToShow;}
function buildSmallPopup(popID,title,content,iframeURL,closeEsc,closeEnter,oneColor,closeLocation) {if (iframeURL!='') {content = '
';}
var x = '';$('body').append(x);popupWinScrollAction(1);setTimeout(function() {$('#'+popID+'').find('.content').addClass('open');},100);$('#'+popID+' .cover').click(function() {buildSmallPopup_CloseAction(popID);});}
function buildSmallPopup_CloseAction( popID ) {var $popup = $('#'+popID);if ( popID == 'popupCart' && window.location.pathname == '/-order1/' ) {$(document).trigger('order1.reload');}
setTimeout(function() {$popup.find('.content').removeClass('open');},100);setTimeout(function() {$('#'+popID).remove();popupWinScrollAction(0);},700);}
function buildPopup( popID, title, content, iframeURL, closeEsc, closeEnter, oneColor, closeLocation, customClasses ) {if ( $('#'+popID).length !== 0 ) return;if ( iframeURL != '' ) {var iClass = '';if ( iframeURL.indexOf("youtube.com") > -1 ) iClass = 'videoSize';if ( iframeURL.indexOf("vimeo.com") > -1 ) iClass = 'videoSize';content = '
';}
var x = '';$('body').append(x);popupWinScrollAction(1);$('#'+popID).find('.page').css({ overflow: 'hidden' });setTimeout(function() {$('#'+popID).addClass('open');if ( iframeURL == '' ) $('#'+popID).find('.page').css({ overflow: 'auto' });$(document).trigger('build_popup.open');},100);$('#'+popID).find('.popupCloseButton').click(function() {buildPopup_CloseAction(popID);});$('#'+popID+' .cover').click(function() {buildPopup_CloseAction(popID);});if ( iframeURL !='' ) {$('#'+popID+'_iFrame').on("load",function() {setTimeout(function() {var screenHeight = $('#pagePopupWinID .page').outerHeight(true);$('#pagePopupWinID_iFrame').height(screenHeight);if ( !is_touch_device() ) {$('#'+popID).find('.page').css({ overflow: 'hidden' });} else {$('#'+popID).find('.page').css({ overflow: 'auto' });}},300);});}
$(document).keyup(function(e) {if (closeEsc==true && e.keyCode === 27) {buildPopup_CloseAction(popID);}});}
function is_touch_device() {return 'ontouchstart' in window // works on most browsers
|| navigator.maxTouchPoints; // works on IE10/11 and Surface
};function buildPopup_CloseAction( popID ) {var $popup = $('#'+popID);$popup.find('.page').css({overflow: 'hidden'});$popup.removeClass('open');setTimeout(function() {$('#'+popID).remove();if ( $('.popupWin').length == 0 ) {popupWinScrollAction(0);}},700);$(document).trigger('build_popup.close');}
function buildPopup_CloseAllPopupsInPage() {if ($('.popupWin').length>0) {$('.popupWin').each(function() {var popID = $(this).attr('id');buildPopup_CloseAction(popID);});}}
function jqueryValidatorExtent() {jQuery.extend(jQuery.validator.messages, {required: translations.jqueryValidMsgRequire,remote: translations.jqueryValidMsgRemote,email: translations.jqueryValidMsgEmail,url: translations.jqueryValidMsgUrl,date: translations.jqueryValidMsgDate,dateISO: translations.jqueryValidMsgDateISO,number: translations.jqueryValidMsgNumber,digits: translations.jqueryValidMsgDigits,creditcard: translations.jqueryValidMsgCreditcard,equalTo: translations.jqueryValidMsgEqualTo,accept: translations.jqueryValidMsgAccept,maxlength: jQuery.validator.format(translations.jqueryValidMsgMaxlength),minlength: jQuery.validator.format(translations.jqueryValidMsgMinlength),rangelength: jQuery.validator.format(translations.jqueryValidMsgRangelength),range: jQuery.validator.format(translations.jqueryValidMsgRange),max: jQuery.validator.format(translations.jqueryValidMsgMax),min: jQuery.validator.format(translations.jqueryValidMsgMin)});jQuery.validator.addMethod('no-spaces-only', function(value, element) {return this.optional(element) || $.trim(value).length != 0;}, translations.pleaseEnterValidText);}
S123.VideoHandler = function () {var _ = {};_.init = function() {$('.s123-video-handler:not([data-is-full-screen="true"])').each(function() {_.addClickEvent($(this));});if ( isMobileDevice.any() ) {$('.s123-video-handler:not([data-player="youtube"]):not([data-is-full-screen="true"])').imagesLoaded().progress( function( instance, image ) {s123VideoHandler($(image.img).closest('.s123-video-handler'));});}
$('.s123-video-handler[data-is-full-screen="true"]').on('click.VideoHandler', function( event ) {var $this = $(this);var src = $this.data('video');$.magnificPopup.open({mainClass: 'mfp-e-product-gallery',delegate: '.e-p-mfp-image', // Categories Filter
closeOnContentClick: true,closeBtnInside: false,tLoading: translations.loading, // Text that is displayed during loading
type: 'iframe',items: {src: src},iframe: {markup: '
',patterns: {youtube: {index: 'youtube.com/',id: function(url) {var matches = url.match(/[\\?\\&]v=([^\\?\\&]+)/);if ( !matches || !matches[1] ) return null;return matches[1];},src: '//www.youtube.com/embed/%id%?autoplay=1'
},vimeo: {index: 'vimeo.com/',id: function(url) {var matches = url.match(/(https?:\/\/)?(www.)?(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/);if ( !matches || !matches[5] ) return null;return matches[5];},src: '//player.vimeo.com/video/%id%?autoplay=1'
},site123: {index: $GLOBALS['cdn-user-files'],id: function( url ) {if ( isMobileDevice.any() ) url += '&autoplay=0';return url;},src: '/include/globalVideoPlayer.php?websiteID='+$('#websiteID').val()+'&website_uniqueID='+$('#website_uniqueID').val()+'&cad=1&url=%id%'},site123Processing: {index: '/files/images/video-processing.png',id: function( url ) {if ( isMobileDevice.any() ) url += '&autoplay=0';return url;},src: '/include/globalVideoPlayer.php?websiteID='+$('#websiteID').val()+'&website_uniqueID='+$('#website_uniqueID').val()+'&cad=1&url=%id%'}}},});});};_.addClickEvent = function( $el ) {$el.on('click.VideoHandler', function() {s123VideoHandler($(this));});};return _;}();function s123VideoHandler( $obj ) {var player = $obj.data('player');var video_id = $obj.data('video-id');var videoURL = $obj.data('video');var customStyle = $obj.find('img').attr('style') ? $obj.find('img').attr('style') : '';var width = $obj.find('img').width();var height = $obj.find('img').height();var originalHtml = $obj.prop('outerHTML');if ( player === 'site123') {videoURL = '/include/globalVideoPlayer.php?websiteID='+$('#websiteID').val()+'&website_uniqueID='+$('#website_uniqueID').val()+'&cad=1&url=' + encodeURIComponent(videoURL)+'&width='+width+'&height='+height;}
if ( isMobileDevice.any() ) {if ( player === 'site123') {videoURL += '&autoplay=false';} else if ( player === 'vimeo') {videoURL = videoURL.replace('autoplay','disable-autoplay');}} else {videoURL += '&autoplay=true';}
var $iframe = $('
');$iframe.data('original-el',originalHtml);$obj.replaceWith($iframe);$(document).one('S123Resize.start.VideoHandler', function() {var $el = $($iframe.data('original-el'));$el.css('visibility','hidden');$iframe.replaceWith($el);$el.imagesLoaded().done( function( instance, image ) {$el.css('visibility','visible');});S123.VideoHandler.addClickEvent($el);});(function () {if ( player !== 'youtube' ) return;if ( !isMobileDevice.any() ) return;var youtube_player;if ( $('#youtube_player_api').length === 0 ) {var script = document.createElement('script');script.id = 'youtube_player_api';script.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];firstScriptTag.parentNode.insertBefore(script,firstScriptTag);window.onYouTubePlayerAPIReady = function() {youtube_player = YouTubePlayerInitialize(video_id);}} else {youtube_player = YouTubePlayerInitialize(video_id);}
function onPlayerReady( event ) {if ( isMobileDevice.iOS() ) event.target.mute();event.target.playVideo();}
function YouTubePlayerInitialize( video_id ) {youtube_player = new YT.Player('v-h-'+video_id, {events: {'onReady': onPlayerReady}});return youtube_player;}})();}
function s123EditorVideoTagsHandler() {$('.fr-view video').each(function() {var $video = $(this);var src = $video.attr('src');var extension = src.split("?")[0].split('.').pop();var thumbnail = src.replace('.'+extension,'-thumbnail.jpg');$video.replaceWith('

');});}
function WizardNotificationUpdate() {if ( IsWizard() ) topWindow.WebsiteNotification.update();}
function calculateCouponDiscount( totalPrice, $couponDiscount, $couponType ) {if ( $couponDiscount.length === 0 || !$.isNumeric($couponDiscount.val()) ) return 0;if ( $couponType.length === 0 || !$.isNumeric($couponType.val()) ) return 0;if ( $couponType.val() == '0' ) {return (parseFloat(totalPrice) * parseFloat($couponDiscount.val()) / 100);} else {return totalPrice > 0 ? parseFloat($couponDiscount.val()) : 0;}}
function getCouponDetails( callback, couponCode, w, websiteID, versionNUM, total ) {if ( couponCode.length === 0 ) return;$.ajax({type: "POST",url: "/versions/"+versionNUM+"/wizard/orders/front/getCouponsAjax.php",data: 'w='+w+'&websiteID='+websiteID+'&couponCode='+couponCode+'&total='+total,success: function(data) {try {data = jQuery.parseJSON(data);} catch (e) { return; }
if (callback) callback.call(this,data);}});}
function getFormValues( $form ) {var values = {};$.each($form.serializeArray(), function(i, field) {values[field.name] = field.value;});return values;}
function getScrollbarWidth() {if ($(document).height() > $(window).height()) { //Make sure this page have a scroll
var outer = document.createElement("div");outer.style.visibility = "hidden";outer.style.width = "100px";outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps
document.body.appendChild(outer);var widthNoScroll = outer.offsetWidth;outer.style.overflow = "scroll";var inner = document.createElement("div");inner.style.width = "100%";outer.appendChild(inner);var widthWithScroll = inner.offsetWidth;outer.parentNode.removeChild(outer);return widthNoScroll - widthWithScroll;} else {return 0; //If this page is short without a scroll we don't add padding
}}
function popupWinScrollAction(addBOO) {var scrollWidth = getScrollbarWidth();if (addBOO==1 && scrollWidth>0) {$('body').addClass('popupWinScroll');$('body').css('padding-right',scrollWidth+'px');$('#mainNavMobile').css('padding-right',scrollWidth+'px');$('#showSmallAdOnScroll').css('padding-right',scrollWidth+'px');if (layoutMenuPositionTXT=='left' || layoutMenuPositionTXT=='right') {} else {$('#mainNav').css('padding-right',scrollWidth+'px');$('#mainNav #top-menu.affix').css('padding-right',scrollWidth+'px');}} else {$('body').removeClass('popupWinScroll');$('body').css('padding-right','0px');$('#mainNavMobile').css('padding-right','0px');$('#showSmallAdOnScroll').css('padding-right','0px');if (layoutMenuPositionTXT=='left' || layoutMenuPositionTXT=='right') {} else {$('#mainNav').css('padding-right','0px');$('#mainNav #top-menu.affix').css('padding-right','0px');}}}
function Order_FixWebsiteDomainUnderStoreSSL() {var $store_ssl_domain = $('#store_ssl_domain');var $orderScreen = $('#orderScreen');var $websiteDomain = $('#websiteDomain');if ( $orderScreen.length === 0 || $websiteDomain.length === 0 || $store_ssl_domain.length === 0 ) return;if ( location.href.indexOf($store_ssl_domain.val()) === -1 ) return;if ( $websiteDomain.val().length === 0 ) return;$('a').each(function() {var $this = $(this);var href = $this.attr('href');if ( href && href.charAt(0) == '/' ) {var newHref = $websiteDomain.val() + href;$this.attr('href',newHref);}});}
function IsHomepage() {return $('html.home_page').length === 1;}
function IsInsidePage() {return $('html.inside_page').length === 1;}
function IsRichPage() {return $('html.rich_page').length === 1;}
function IsDataPage() {return $('.s123-page-data').length > 0;}
function IsWizard() {return topWindow.Wizard ? true : false;}
function IsOnlyContent() {var path = window.location.pathname.split("/");return path.pop() == '-content';}
var topWindow = function() {var win = window;var top = win;while ( win.parent != win ) {try {win.parent.document;top = win.parent;} catch (e) {}
win = win.parent;}
return top;}();var holdChangeTextIntervals = []; //Hold all active interval so it will be easy to kiil them before trigger PAGE LOAD from interface
function homepageRandomText() {$( document ).on( 's123.page.ready.homepageRandomText', function( event ) {holdChangeTextIntervals.forEach(function(element) {clearInterval(element);});$('.homepageRandomText').each(function() {homepageRandomTextAction(this,'no');});$('.homepageRandomTextStop').each(function() {homepageRandomTextAction(this,'yes');});});}
function homepageRandomTextAction(t,hasStop) {var $this = $(t);var words = $this.data('text');var counter = 0;var speed = 5000;words = words.split('|');if (words.length>0) {if (words[words.length-1].includes('t:')) {var speedEle = words[words.length-1].replace(/t:(.*)/, '$1');if ($.isNumeric(speedEle)) {speed = speedEle;words.splice(words.length-1, 1);}}
$this.html(words[counter]).addClass('elementToFadeIn');counter++;var inst = setInterval(function() {$this.removeClass('elementToFadeIn');setTimeout(function() { $this.html(words[counter]).addClass('elementToFadeIn'); }, 50);counter++;if (counter >= words.length) {counter = 0;if (hasStop=='yes') {clearInterval(inst); // uncomment this if you want to stop refreshing after one cycle
}}}, speed);holdChangeTextIntervals.push(inst);}}
var ClientZone = function() {var CZ = {};CZ.init = function() {$( document ).on( 's123.page.ready', function( event ) {CZ.updateClientIcon();});};CZ.updateClientIcon = function() {var $clientZoneLink = $('.header-client-zone-wrapper .client-zone-link');if ( $clientZoneLink.length === 0 ) return;var $client = tryParseJSON($.cookie($('#websiteID').val()+'-clientZone'));if ( !$client ) return;$clientZoneLink.removeAttr('data-image');$clientZoneLink.removeAttr('data-letters');if ( $client.profile_image ) {$clientZoneLink.attr('data-image','true');$clientZoneLink.css('background-image','url('+getImageWRV1(100,$client.profile_image)+')');} else if ( $client.name ) {$clientZoneLink.attr('data-letters',$client.name[0]);$clientZoneLink.css('background-image','');} else if ( $client.email ) {$clientZoneLink.attr('data-letters',$client.email[0]);$clientZoneLink.css('background-image','');}
if ( $client.name !== 0 ) $clientZoneLink.attr('title',$client.name);};CZ.getClientAddress = function( callback ) {var $client = tryParseJSON($.cookie($('#websiteID').val()+'-clientZone'));if ( !$client ) return;$.ajax({type: 'POST',url: '/versions/'+$('#versionNUM').val()+'/wizard/clientZone/getClientAddress.php',data: {websiteID : $('#websiteID').val(),w : $('#w').val()},success: function(response) {response = JSON.parse(response);if ( response.status == 'Success' ) {if ( callback ) callback.call(this,response.addresses);}}}).always(function() {$('.mainOrderBox .order-spacing-box .order-form-box').show();});}
return CZ;}();var CartCounter = function() {var CC = {};CC.init = function() {if ( S123.QueryString.onlyContent == 1 ) return;$( document ).on( 's123.page.ready', function( event ) {CC.updateCartIcon();});CC.oldCustomersSupport();};CC.updateCartIcon = function() {var $headerCartWrapper = $('.header-cart-wrapper');if ( $headerCartWrapper.length === 0 ) return;var productsNumber = $.cookie($('#websiteID').val()+'-cartCounter');if ( !$.isNumeric(productsNumber) ) productsNumber = 0;if ( parseInt(productsNumber) === 0 ) {if ( !$headerCartWrapper.hasClass('show-static') ) {if ( $('#mainNavMobile .navActions > li.landingPageBars').length == 0 ) {$('#mainNavMobile .navActions > li:first').not('.landingPageBars').show();window.mainNavMobile_page_loaded_icons_states = $('#mainNavMobile .navActions > li:visible')
.not('.header-wish-list')
.not('.header-cart-wrapper');}
$headerCartWrapper.hide();ResetMoreButton();}
$headerCartWrapper.find('.count').hide();} else {if ( !$headerCartWrapper.hasClass('show-static') ) {if ( $('#mainNavMobile .navActions > li.landingPageBars').length == 0 ) {$('#mainNavMobile .navActions > li:first').hide();window.mainNavMobile_page_loaded_icons_states = $('#mainNavMobile .navActions > li:visible')
.not('.header-wish-list')
.not('.header-cart-wrapper');}
$headerCartWrapper.show();$headerCartWrapper.closest('.header-column-menu-actions').addClass('side-menu-bottom-line');ResetMoreButton();}
productsNumber = CC.getCartCountNumber($headerCartWrapper,productsNumber);$headerCartWrapper.find('.count').html(productsNumber).css({ display: 'flex' });}};CC.getCartCountNumber = function( $headerCartWrapper, productsNumber ) {const productsNumberStr = productsNumber.toString();const productsNumberLen = productsNumberStr.length;const suffixes = ['', 'k', 'm', 'b', 't'];const suffixIndex = Math.ceil(productsNumberLen / 3) - 1;const suffix = suffixes[suffixIndex];const productsNumberDigits = productsNumberLen % 3 === 0 ? 3 : productsNumberLen % 3;const prefix = productsNumberStr.slice(0, productsNumberDigits);const newNumberStr = `${prefix}${suffix}`;if ( newNumberStr.length == 3 ) {$headerCartWrapper.find('.count').addClass('reduceCountNumber');} else if ( newNumberStr.length > 3 ) {$headerCartWrapper.find('.count').addClass('reduceCountNumber reduceCountNumber-4');} else {$headerCartWrapper.find('.count').removeClass('reduceCountNumber reduceCountNumber-4');}
return newNumberStr;}
CC.oldCustomersSupport = function() {if ( $.cookie('CartCount') !== 'yes' ) return;$.ajax({type: "GET",url: "/versions/"+$('#versionNUM').val()+"/wizard/orders/front/countUserCart.php",data: 'w='+$('#w').val()+'&websiteID='+$('#websiteID').val()+'&tranW='+websiteLanguageCountryFullCode+'&moduleTypeNUM=37'});CC.updateCartIcon();};return CC;}();S123.Pjax = function() {var that = {active: false,isMobile: null,pjaxSupported: null};that.init = function() {that.isMobile = findBootstrapEnvironment() === 'xs';that.pjaxSupported = $('#pjaxSupported').val();if ( $('#onepage').val() !== '0' ) return;if ( that.pjaxSupported != '1' ) return;that.breadcrumbInitialize();that.pjaxInit();NProgress.configure({showSpinner: false});document.addEventListener('pjax:send',function( event ) {$(document).trigger('pjax_magnific_popup_reset');NProgress.start();$('.s123-front-last-element').nextAll().remove();that.triggerSend();});document.addEventListener('pjax:complete',function( event ) {var is_data_page = that.isDataPage(event.request.response);if ( is_data_page ) {that.loadDataPageResources(event);} else {that.completeRequestActions(event,0);}});};that.completeRequestActions = function( event, is_trigger_data_ready ) {that.breadcrumbInitialize();if ( typeof FB !== 'undefined' ) FB.XFBML.parse();window.grecaptcha = null;window.recaptcha = null;NProgress.done();if ( is_trigger_data_ready ) TriggerS123PageReadyData();TriggerS123PageReady();TriggerS123PageLoad();S123.Pjax.refresh();that.triggerComplete();};that.loadDataPageResources = function( event ) {if ( that.isDataResourcesLoaded ) {that.completeRequestActions(event,1);return;}
that.isDataResourcesLoaded = true;var $request_response = $(event.request.response);var resource_deferreds = [];var $website_front_data_css = $request_response.filter('.website-front-data-css');$website_front_data_css.each(function( index, resource ) {var d1 = $.Deferred();$(resource).load(function() {d1.resolve();})
resource_deferreds.push(d1);});$('head').append($website_front_data_css);var $website_front_data_js = $request_response.filter('.website-front-data-js');$website_front_data_js.each(function( index, resource ) {var d1 = $.Deferred();$.getScript(resource.src)
.done(function( script, textStatus ) {d1.resolve();});resource_deferreds.push(d1);});$.when.apply($,resource_deferreds).done(function() {that.completeRequestActions(event,0);});};that.pjaxInit = function() {var pjax_hash_delay = window.location.hash.length !== 0 ? 100 : 0;setTimeout(function(){that._p = new Pjax({elements: '.s123-fast-page-load',selectors: ['.s123-js-pjax','#s123PjaxMainContainer','#top-menu',"#top-menu-mobile"],scrollRestoration: true,cacheBust: false});that._p._handleResponse = that._p.handleResponse;that._p.handleResponse = function(responseText, request, href, options) {if ( request.status == 404 ) window.location.href = request.responseURL;var browsedPageType = that.getBrowsedPageType(request.responseText);that.htmlTagClassesHandler(browsedPageType);if ( request.responseText.match("')+1);browsedPageType.isHomepage = str.indexOf('home_page') !== -1;browsedPageType.isRichpage = str.indexOf('rich_page') !== -1;return browsedPageType;};that.isDataPage = function( str ) {var $str = $(str);return $str.find('.s123-page-data').length > 0;};that.handleHashInUrl = function() {if ( window.location.hash.length === 0 ) return;var $hash_element = $(window.location.hash);if ( $hash_element.length === 0 ) return;$('html, body').scrollTop( $(window.location.hash).offset().top - $('#mainNavMobile').outerHeight());};that.triggerComplete = function() {$(document).trigger('s123.pjax.complete');}
that.triggerSend = function() {$(document).trigger('s123.pjax.send');}
return that;}();function getImageWRV1( size, path ) {if ( !size || !path ) return path;var ext = path.split('.').pop();path = setImagesCDN(path);if ( ext === 'svg' ) return path;return path.replace('normal_',size+'_');}
function setImagesCDN( path ) {if ( !path ) return path;if ( $GLOBALS['is_local_server'] ) return path;try {var Url = new URL(path);var host = Url.host.toLowerCase();if ( host === 'cdn-cms-localhost.f-static.com' ) {return path;} else if ( host === 'second-cdn.f-static.com' || host.indexOf("cdn-cms") !== -1 || host.indexOf("s123-cdn") !== -1 ) {path = path.replace(host,'images.cdn-files-a.com');}} catch (e) {}
return path;}
function tryParseJSON( str ) {try {var Obj = JSON.parse(str);if ( Obj && typeof Obj === "object" ) {return Obj;}} catch (e) {}
return false;}
function generateSharingPopoverHTML( popOverTitle, url, title ) {html = '
';return html;}
function sharePopover( $button, html ) {var $html = $(html);var $sharingURL = $html.find('.share-reply-buttons .sharing-url');var clipboard = new Clipboard('.popover.share-reply .share-reply-buttons .sharing-url', {target: function() {return document.querySelector('.popover.share-reply .share-reply-buttons .sharing-url');}});$sharingURL.click(function() {$.gritter.add({title: translations.linkCopiedToClipboard,class_name: 'gritter-success',time: 6000});})
$button.popover({container: 'body',html: 'true',content: $html,trigger: 'manual',template: '
',placement: function(popover, button) {return isMobileDevice.any() ? 'auto' : 'top';}});$button.popover('show');$button.on('shown.bs.popover', function () {$html.find('button').on('click', function(){destroySharePopover();});$(document).on('mousedown.shareDestroyPopover', function ( event ) {if ( $(event.target).closest('.popover.share-reply').length === 0 ) {destroySharePopover();}});});function destroySharePopover() {$button.popover('destroy');$(document).off('mousedown.shareDestroyPopover');$(window).off('blur.shareDestroyPopover');$(window).off('scroll.shareDestroyPopover');}}
function Google_reCaptcha( reCaptcha ) {grecaptcha.ready(function() {grecaptcha.render({'sitekey' : '6LcICoEUAAAAACB-cKbhks2djWsryQxVdJe1eYBi','callback' : reCaptcha.callback,'action' : reCaptcha.action});grecaptcha.execute();});}
function showPrice( currency, price ) {if ( !$.isNumeric(price) ) return html;if ( currency.symbolFirst ) {var html = '
' + currency.symbol + '' + price + '';} else {var html = '
' + price + '' + currency.symbol + '';}
return html;}
function FitHomepageTextToWebsiteScreenWidth() {$( document ).on( 's123.page.ready.FitHomepageTextToWebsiteScreenWidth', function( event ) {fitTextToWebsiteScreenWidth('#home_siteSlogan',true);fitTextToWebsiteScreenWidth('#home_siteSlogan_2',true);fitTextToWebsiteScreenWidth('#home_SecondSiteSlogan',true);fitTextToWebsiteScreenWidth('.promoText1',false);fitTextToWebsiteScreenWidth('.promoText2',false);fitTextToWebsiteScreenWidth('.promoText3',false);fitTextToWebsiteScreenWidth('.promoText',false);});}
function fitTextToWebsiteScreenWidth( textEle, hasCssVar ) {var i = 0;var bodyWidth = $('body').width() - 50;var $textEle = $(textEle);if ( $textEle.length === 0 ) return;if ( hasCssVar ) $textEle.css('font-size','');if ( whatScreen.any() == 'desktop' ) return;while ( bodyWidth < $textEle.containerTextWidth_site123($textEle.css('font-size')) && i <= 50 ) {var fontSize = parseInt($textEle.css('font-size'),10);fontSize = fontSize - 5;if ( fontSize > 0 ) {$textEle.css('font-size',fontSize + 'px');} else {break;}
i++;}}
$.fn.containerTextWidth_site123 = function( fontSize ) {var $this = $(this);if ( $this.length === 0 ) return;var bodyWidth = $('body').width()-50;var fontFamily = $this.css('font-family').replace('"','\'');var html_calc = '
' + $this.html() + '
';$('body').append(html_calc);var width = $('#containerTextWidth_site123').width();$('#containerTextWidth_site123').remove();return width;};var s123MobileMenu = new function() {var that = this;that.init = function( settings ) {$( document ).on( 's123.page.ready', function( event ) {that.isRtl = $('html').attr('dir') === 'rtl' ? true : false;that.poupID = 'popupFloatDivMenu';that.animation = 400;that.isOpened = false;$('.header-menu-wrapper .mobile-menu-btn').off('click').click(function() {var $this = $(this);that.$source = $('#top-menu-mobile > ul').clone();that.closeLocation = $this.data('closeLocation');that.menuType = $this.data('menu-type');that.isMobile = $this.data('is-mobile');that.menuColor = $this.attr('data-menu-color');if ( !that.$source ) return;openMenu();that.$container = $('#popupFloatDivMenu');that.$page = that.$container.find('.page');that.$ul = that.$container.find('.navPagesPopup');that.$navPagesPopupActionButtons = that.$container.find('.navPagesPopupActionButtons');that.$categories = that.$container.find('.moduleMenu.dropdown-submenu > a');that.$container.addClass(that.menuColor);that.$container.addClass(colorContrast(that.menuColor));that.$categories.removeClass('page-scroll');dropdownClickFlag = 1;that.createCategoryOnClick();addPajaxSupport();addPopupCustomEvents();});topWindow.$(topWindow.document).off('mobileMenuColorCorrection').on('mobileMenuColorCorrection', function(event, val) {if ($('#popupFloatDivMenu').hasClass('open')) {$('#popupFloatDivMenu').addClass(colorContrast(val));}})});};function colorContrast( colorClass ) {const delta = 0.75;const cssGlobalVar = getComputedStyle(document.documentElement);const globalMainColor = cssGlobalVar.getPropertyValue('--global_main_color');const colorType = ColorsDetector.isLightDarkColor(globalMainColor.trim());if ( colorClass == 'm-w' ) {return ColorsDetector.hexColorDelta(globalMainColor.trim(),'#ffffff') > delta ? 'color-contrast' : '';} else if ( colorClass == 'm-g' ) {return ColorsDetector.hexColorDelta(globalMainColor.trim(),'#ebedf0') > delta ? 'color-contrast' : '';} else if ( colorClass == '' ) {return ColorsDetector.hexColorDelta(globalMainColor.trim(),'#000000') > delta ? 'color-contrast' : '';} else if ( colorClass == 'm-m-t-w' ) {if ( colorType == 'light' ) {return 'color-contrast-black';} else if ( colorType == 'dark' ) {return 'color-contrast';}}
return '';}
function addPajaxSupport() {that.$ul.find('a').each(function() {var $this = $(this);if ( $this.parent().hasClass('dropdown-submenu') ) return;if ( $this.attr('target') == '_blank' ) return;$this.addClass('s123-fast-page-load');});S123.Pjax.refresh();}
function addPopupCustomEvents() {setTimeout(function() {var navHeight = $('#popupFloatDivMenu .navPagesPopup').outerHeight(true)+100;var actionHeight = $('.navPagesPopupActionButtons').outerHeight(true);var screenHeight = $('#popupFloatDivMenu .page').outerHeight(true);if ( navHeight + actionHeight > screenHeight ) {$('#popupFloatDivMenu .navPagesPopup').height(screenHeight-actionHeight-15);} else {$('#popupFloatDivMenu .navPagesPopup').height(navHeight-15);}
$('#popupFloatDivMenu .navPagesPopup .site-dropdown-menu').css('opacity','1');},150);activeDropDownMenusAction();$('#popupFloatDivMenu .navPagesPopup li').not('.dropdown-submenu').find('a').click(function() {buildPopup_CloseAction('popupFloatDivMenu');});$('#popupFloatDivMenu .navPagesPopupActionButtons_part2 a').click(function() {buildPopup_CloseAction('popupFloatDivMenu');});ActivePopupActionButtonsInPage();$('#popupFloatDivMenu .navPagesPopupActionButtons_part1 a.actionButton.btn-primary-action-button-4').addClass('orderOpenCart')
$(document).trigger('s123.page.ready.pageScrollByClick');$(document).trigger('s123.page.ready.ActiveLanguageButton');$(document).trigger('s123.page.ready.wish_list');$(document).trigger('s123.page.ready.activeOrderPopup');}
that.createCategoryOnClick = function() {that.$categories.each(function() {var $this = $(this);if ( $this.parent().children('.site-dropdown-menu').length === 0 ) return;$this.off('click.mobile_categories').on('click.mobile_categories', function( e ) {e.preventDefault();e.stopPropagation();that.contentOffset = $(window).width();$this.parent().addClass('selected-category');if ( !$this.hasClass('active-cat') ) {that.menuHeight = that.$ul.outerHeight();that.menuTop = that.$ul.offset().top - $(window).scrollTop();var menuModuleId = $this.parent().data('menu-module-id');that.$selectedCat = $this.closest('.navPagesPopup').clone();that.$selectedCat.children().each(function( index, page ) {if ( $(page).data('menu-module-id') != menuModuleId || !$(page).hasClass('selected-category') ) {$(page).remove();} else {$(page).find('.site-dropdown-menu').addClass('demo-ul');}});replaceDemoContentWithOriginal(menuModuleId);that.$selectedCat.css('overflow','hidden');openCategory();animate('show');screenResizeHandler();}});});};function replaceDemoContentWithOriginal( menuModuleId ) {var $selectedCategory = that.$selectedCat.children().first();var $categoryPages = null;var $category = $selectedCategory.children('a');$category.addClass('active-cat');if ( IsIE11() ) {$category.prepend('
 ');$category.children('span').last().remove();} else {$category.prepend(S123.s123IconToSvg.getHtml('caret-'+(that.isRtl ? 'right' : 'left'),'close-cat','')+' ');$category.children('i').last().remove();}
that.$categoryPagesParent = that.$ul.find('li[data-menu-module-id="'+menuModuleId+'"].dropdown-submenu.selected-category');$selectedCategory.find('.demo-ul').replaceWith(that.$categoryPagesParent.children('.site-dropdown-menu'));$categoryPages = $selectedCategory.find('.site-dropdown-menu');$categoryPages.addClass('fancy-scrollbar');$categoryPages.addClass('active-cat-content');$categoryPages.css('max-height',that.menuHeight - 50 +'px');}
function animate( action, callBack ) {var animation = {ul: {},openedCat: {}};var $categoryPages = that.$selectedCat.find('.active-cat-content');that.contentOffset = $(window).width();addRemoveAnimationClass('add',[$categoryPages,that.$container,that.$page,that.$ul,that.$selectedCat]);if ( action == 'show' ) {that.$tmpDiv = $('
');that.$ul.parent().prepend(that.$tmpDiv);if ( that.isRtl ) {that.$selectedCat.css({position: 'absolute',top: that.menuTop,right: that.contentOffset,height: that.menuHeight});animation.openedCat.right = ($(window).width() - (that.$page.offset().left + that.$page.outerWidth())) + 5;that.$ul.css({position: 'absolute',top: that.menuTop,right: ($(window).width() - (that.$page.offset().left + that.$page.outerWidth())) + 5,fontFamily: 'auto',height: that.menuHeight,zIndex: 1 // edge bug fix - element is disappears without z-index
});animation.ul.right = that.contentOffset * -1;} else {that.$selectedCat.css({position: 'absolute',top: that.menuTop,left: that.contentOffset,height: that.menuHeight});animation.openedCat.left = that.$page.offset().left+5;that.$ul.css({position: 'absolute',top: that.menuTop,left: that.$page.offset().left+5,fontFamily: 'auto',height: that.menuHeight,zIndex: 1 // edge bug fix - element is disappears without z-index
});animation.ul.left = that.contentOffset * -1;}
that.$ul.parent().prepend(that.$selectedCat);that.$selectedCat.stop().animate(animation.openedCat,that.animation,function() {that.$selectedCat.css({position: ''});addRemoveAnimationClass('remove',[$categoryPages,that.$selectedCat,that.$container,that.$page]);that.$tmpDiv.remove();that.$ul.css({fontFamily: ''});});that.$ul.stop().animate(animation.ul,that.animation);that.isOpened = true;} else if ( action == 'hide' ) {if ( that.isRtl ) {animation.ul.right = ($(window).width() - (that.$page.offset().left + that.$page.outerWidth())) + 5;animation.openedCat.right = that.contentOffset;} else {animation.ul.left = that.$page.offset().left+5;animation.openedCat.left = that.contentOffset;}
addRemoveAnimationClass('add',[$categoryPages]);that.$selectedCat.css({position: 'absolute'});that.$tmpDiv = $('
');that.$ul.parent().prepend(that.$tmpDiv);that.$selectedCat.stop().animate(animation.openedCat,that.animation, function() {$categoryPages.removeClass();$categoryPages.addClass('site-dropdown-menu');$categoryPages.appendTo(that.$categoryPagesParent);that.$selectedCat.remove();});that.$ul.stop().animate(animation.ul,that.animation, function() {that.$ul.css({position: '',height: that.menuHeight});if ( callBack ) callBack.call(this);addRemoveAnimationClass('remove',[that.$container,that.$page,that.$ul]);});that.$ul.children('.selected-category').removeClass('selected-category');that.isOpened = false;}}
function openCategory() {var $category = that.$selectedCat.find('.active-cat');var $subCat = that.$selectedCat.find('.site-dropdown-menu');that.ulPrevState = that.$ul.scrollTop();$category.closest('li').addClass('active').addClass('open');resetBackButtonEvent($category);$category.closest('li').siblings().hide();}
function resetBackButtonEvent( $category ) {that.$selectedCat.find('.active-cat').on('click.mobile_categories_back', function( event ) {event.preventDefault();animate('hide', function() {hideCategory($category);});});}
function hideCategory( $category ) {$category.parent('.dropdown-submenu').removeClass('active').removeClass('open');that.$selectedCat.find('.active-cat').off('click.mobile_categories_back');$category.parent().siblings().show();that.$tmpDiv.remove();that.$ul.scrollTop(that.ulPrevState);}
function generateHTML() {if ( IsIE11() ) {that.$source.find('.dropdown-submenu a > span:not(.txt-container)').removeClass('fa-caret-down')
.addClass('fa-caret-' + (that.isRtl ? 'left' : 'right' ));} else {that.$source.find('.dropdown-submenu a > i.s123-icon-converter').replaceWith(S123.s123IconToSvg.getHtml('caret-'+(that.isRtl ? 'left' : 'right' ),'',''));}
var html = '';html += '';return html;}
function openMenu() {var customClass = '';var addCustomCover = false;switch ( that.menuType ) {case 0:customClass = '';break;case 1:customClass = 'side-menu';addCustomCover = true;break;case 2:customClass = 'side-menu half-width';addCustomCover = true;break;}
if ( that.isMobile ) {customClass += ' is-mobile';}
buildPopup(that.poupID,'',generateHTML(),'',true,true,true,that.closeLocation,customClass);if ( addCustomCover ) {var $customCover = $('#'+that.poupID).find('.cover').clone(true,false);$customCover.removeClass('cover');$customCover.addClass('custom-menu-cover');$('#'+that.poupID).append($customCover);}}
function screenResizeHandler() {$(window).off('resize.mobile_menu').on('resize.mobile_menu', function() {that.contentOffset = $(window).width();that.menuHeight = that.$page.height() - that.$navPagesPopupActionButtons.outerHeight() - 10;that.menuTop = that.$ul.offset().top - $(window).scrollTop();that.$ul.css({height: that.menuHeight});if ( that.isOpened ) {that.menuTop = that.$selectedCat.offset().top - $(window).scrollTop();that.$ul.css({top: that.menuTop,height: that.menuHeight});that.$selectedCat.css({top: that.menuTop,height: that.menuHeight});that.$selectedCat.find('.active-cat-content').css({maxHeight: that.menuHeight});if ( that.isRtl ) {that.$ul.css({right: that.contentOffset * -1});} else {that.$ul.css({left: that.contentOffset * -1});}}});}
function addRemoveAnimationClass( action, elements ) {switch ( action ) {case 'add':for( var i = 0; i < elements.length; i++ ) {elements[i].addClass('m-m-progress');}
break;case 'remove':for( var i = 0; i < elements.length; i++ ) {elements[i].removeClass('m-m-progress');}
break;}}
return that;}();function moduleLayoutCategories_shadow() {$( document ).on( 's123.page.ready', function( event ) {$.each($('.s123-module .s123-categories'), function() {var $this = $(this);var $categoriesContainer = $this.find('ul');var $mrsFirst = $('
');var $mrsLast = $('
');$this.prepend($mrsFirst);$this.append($mrsLast);if ( $this.closest('.s123-module-gallery').length > 0 && !$this.hasClass('col-xs-12') ) {$mrsFirst.css({left: 0});$mrsLast.css({right: 0});}});});}
var ProgressveWebApp = new function() {var that = this;that.init = function() {$( document ).on( 's123.page.load.progressve_web_app', function( event ) {if ( typeof pwaSettings === 'undefined' ) return;if ( 'serviceWorker' in navigator ) {navigator.serviceWorker.register('/sw.js');}
if ( !pwaSettings.enableMessage ) {window.addEventListener('beforeinstallprompt', function( e ) {e.preventDefault();});}});};return that;}();function s123InfiniteScroll( settings ) {var that = {};that.init = function() {that.$container = settings.$container;that.ajax = settings.ajax;that.inProgress = false;that.pageNum = 2;that.initilized = false;that.disabled = false;that.id = settings.id;that.offset = settings.offset;that.loader = settings.loader;that.$loading = $(generateHtml());that.$container.parent().append(that.$loading);that.addLoadNextPageAbility();that.initilized = true;that.$container.data('s123InfiniteScroll',that);};that.addLoadNextPageAbility = function() {$(window).off('scroll.s123InfiniteScroll'+that.id).on('scroll.s123InfiniteScroll'+that.id, function() {if ( that.disabled ) return;if ( $(window).scrollTop() + $(window).height() >= that.$container.height() - that.offset ) {that.getPage();that.inProgress = true;}});};that.destroy = function() {$(window).off('scroll.s123InfiniteScroll'+that.id);that.$loading.remove();if ( that.request ) that.request.abort();};that.getPage = function() {if ( that.inProgress ) return;showLoadingAnimation();that.ajax.data.pageNumber = that.pageNum;that.request = $.ajax({type: that.ajax.type,url: that.ajax.url,data: that.ajax.data,success: function( data ) {data = tryParseJSON(data);that.pageNum++;that.inProgress = false;hideLoadingAnimation();if ( !data.hasNextPage ) {that.destroy();}
if ( that.ajax.success ) that.ajax.success.call(this,data);that.request = null;}});};that.disable = function() {that.disabled = true;};that.enable = function() {that.disabled = false;};function generateHtml() {var html = '';html += '';return html;}
function showLoadingAnimation() {if ( that.loader ) {for (var i = 0; i < that.ajax.data.limit; i++ ) {var $template = $(that.loader.template);$template.addClass('w-i-s-fake');that.loader.$container.append($template);}} else {that.$loading.show();}}
function hideLoadingAnimation() {if ( that.loader ) {that.loader.$container.find('.w-i-s-fake').remove();} else {that.$loading.hide();}}
that.init();return that;}
function IsIE11() {return !!window.MSInputMethodContext && !!document.documentMode;}
S123.popOver = function () {var that = {};that.init = function( settings ) {if ( !settings ) return;if ( settings.$el.length === 0 ) return;that.$el = settings.$el;that.elSelector = settings.elSelector;that.namespace = settings.namespace;that.oneTimeUsage = settings.oneTimeUsage;that.popOverSettings = settings.popOverSettings;that.$el.popover({selector: that.popOverSettings.selector,content: that.popOverSettings.content,html: that.popOverSettings.html,trigger: that.popOverSettings.trigger,template: that.popOverSettings.template,placement: function( popover, input ) {if ( that.popOverSettings.placementCallBack ) {return that.popOverSettings.placementCallBack.call(this);} else {return 'auto';}}});that.$el.on('shown.bs.popover', function ( event ) {that.popOverSettings.content.find('[data-menu-dismiss="popover"]').click(function( event ) {if ( that.oneTimeUsage ) {destroy();} else {hide();}});$(window).on('mousedown.destroyPopover' + '.' + that.namespace, function ( event ) {if ( that.popOverSettings.trigger === 'manual' && $(event.target).closest(that.elSelector).length > 0 ) return;if ( $(event.target).closest('.' + that.selector).length === 0 ) {if ( that.oneTimeUsage ) {destroy();} else {hide();}}});$(window).one('blur.destroyPopover' + '.' + that.namespace, function( event ) {if ( that.popOverSettings.trigger === 'manual' && $(event.target).closest(that.elSelector).length > 0 ) return;if ( that.oneTimeUsage ) {destroy();} else {hide();}});$(document).trigger('s123_pop_over_wrapper.shown' + '.' + that.namespace);})
.on('show.bs.popover', function ( event ) {$(document).trigger('s123_pop_over_wrapper.show' + '.' + that.namespace);})
.on('hide.bs.popover' + '.' + that.namespace, function( event ) {$(document).trigger('s123_pop_over_wrapper.hide' + '.' + that.namespace);});};function hide() {that.$el.popover('hide');$(window).off('mousedown.destroyPopover' + '.' + that.namespace);$(window).off('blur.destroyPopover' + '.' + that.namespace);$(window).off('scroll.destroyPopover' + '.' + that.namespace);}
function destroy() {that.$el.popover('destroy');$(window).off('mousedown.destroyPopover' + '.' + that.namespace);$(window).off('blur.destroyPopover' + '.' + that.namespace);$(window).off('scroll.destroyPopover' + '.' + that.namespace);}
return that;}();S123.globalContactEmail = function() {var that = {};that.init = function() {that.emailBtns = $('[data-toggle="email_menuCallActionIcons"]');that.settings = tryParseJSON($('#globalContactEmailSettings').val());that.custom_form_html = that.settings.custom_form_html ? that.settings.custom_form_html : '';that.emailBtns.off('click').click(function() {var $this = $(this);var $header_email_content = $('#header-email-content').clone();if ( IsWizard() && $this.closest('.s123-module-contact').length !== 0 ) return;if ( $header_email_content.find('a').text().length > 20 ){$header_email_content.find('.global-contact-details-container').addClass('g-c-d-long-text-handler');}
buildPopup('popupFloatDivSearch','',that.buildEmailToolForm(),'',true,true,true,$this.data('closeLocation'),'');S123.globalContactEmail.submitHandler();$(document).trigger('s123.page.ready.wizard_preview_manage_helpers');});};that.buildEmailToolForm = function() {var html = '';html += '
';return html;};that.submitHandler = function () {var $form = $('.g-c-email-form');var customFormMultiSteps = new CustomFormMultiSteps();customFormMultiSteps.init({$form: $form,$nextButton: $form.find('.next-form-btn'),$submitButton: $form.find('.submit-form-btn'),$previousButton: $form.find('.previous-form-btn'),totalSteps: $form.find('.custom-form-steps').data('total-steps')});$form.find('.f-b-date-timePicker').each( function() {var $option = $(this);var $datePicker = $option.find('.fake-input.date-time-picker');var $hiddenInput = $option.find('[data-id="'+$datePicker.data('related-id')+'"]');var $datePickerIcon = $option.find('.f-b-date-timePicker-icon');var formBuilderCalendar = new calendar_handler();$datePicker.data('date-format',$form.data('date-format'));formBuilderCalendar.init({$fakeInput: $datePicker,$hiddenInput: $hiddenInput,$fakeInputIcon: $datePickerIcon,type: 'datePicker',title: translations.chooseDate,calendarSettings: {format: $datePicker.data('date-format'),weekStart: 0,todayBtn: "linked",clearBtn: false,language: languageCode,todayHighlight: true},onSubmit: function( selectedDate ) {$datePicker.html(selectedDate);$hiddenInput.val(selectedDate);}});});CustomForm_DisableTwoColumns($form);var forms_GoogleRecaptcha = new Forms_GoogleRecaptcha();forms_GoogleRecaptcha.init($form);$form.validate({errorElement: 'div',errorClass: 'help-block',focusInvalid: true,ignore: ':hidden:not(.custom-form-step:visible input[name^="datePicker-"])',highlight: function (e) {$(e).closest('.form-group').removeClass('has-info').addClass('has-error');},success: function (e) {$(e).closest('.form-group').removeClass('has-error');$(e).remove();},submitHandler: function( form ) {var $form = $(form);$form.find('button:submit').prop('disabled', true);if ( forms_GoogleRecaptcha.isActive && !forms_GoogleRecaptcha.isGotToken ) {forms_GoogleRecaptcha.getToken();return false;}
$.ajax({type: "POST",url: "/versions/"+$('#versionNUM').val()+"/include/contactEmailO.php",data: $form.serialize(),success: function( data ) {data = tryParseJSON(data);$form.trigger("reset");if ( data.conv_code && data.conv_code.length > 0 ) {var $convCode = $('
' + data.conv_code + '
');$form.find('.conv-code-container').html($convCode.text());}
if ( data.buttonClickAction && data.buttonClickAction == 'redirect' ) {if ( data.buttonLink_afterSubmit.length > 0 ) {if ( IsWizard() ) {buildPopup_CloseAction('popupFloatDivSearch');bootbox.alert({title: translations.previewExternalLinkTitle,message: translations.previewExternalLinkMsg.replace('{{externalLink}}','
'+data.buttonLink_afterSubmit+''),className: 'externalAlert'});} else {buildPopup_CloseAction('popupFloatDivSearch');window.open(data.buttonLink_afterSubmit,'_self');}}} else {$form.addClass("hidden");$(".g-c-email-message-sent-box").show();$(".g-c-email-info-box").hide();$form.next().find(".close-order-thank-you").on("click",function() {buildPopup_CloseAction('popupFloatDivSearch');});}
forms_GoogleRecaptcha.reset();$form.find('button:submit').prop('disabled', false);WizardNotificationUpdate();}});return false;},errorPlacement: function (error, element) {if( element.is('input[type=checkbox]') || element.is('input[type=radio]') ) {var controls = element.closest('div[class*="col-"]');if( controls.find(':checkbox,:radio').length > 0 ) element.closest('.form-group').append(error);else error.insertAfter(element.nextAll('.lbl:eq(0)').eq(0));}
else if( element.is('.select2') ) {error.insertAfter(element.siblings('[class*="select2-container"]:eq(0)'));}
else if( element.is('.chosen-select') ) {error.insertAfter(element.siblings('[class*="chosen-container"]:eq(0)'));}
else {error.appendTo(element.closest('.form-group'));}},});};return that;}();function previewScaleDeviceTypeChange( deviceType ) {$(document).trigger('previewScale.deviceTypeChange',[deviceType]);$(document).trigger('S123PopOver.reposition');}
function previewReloadPreviewCSSReloaded() {$(document).trigger('reloadPreviewCSS.reloaded');}
function CustomFormMultiSteps() {var that = this;that.init = function( settings ) {that.totalSteps = settings.totalSteps;that.$form = settings.$form;that.$nextButton = settings.$nextButton;that.$submitButton = settings.$submitButton;that.$previousButton = settings.$previousButton;that.initMultiStepsButtons();};that.initMultiStepsButtons = function() {that.$previousButton.off('click').on('click',function() {var $step = that.$form.find('.custom-form-step:visible');var step = $step.data('step');var previousStep = step - 1;$step.hide();that.$form.find('.custom-form-step.step-' + previousStep).fadeIn(350);that.$submitButton.hide();that.$nextButton.fadeIn(350);if ( previousStep < 2 ) {that.$previousButton.hide();} else {that.$previousButton.fadeIn(350);}});that.$nextButton.off('click').on('click',function() {var $step = that.$form.find('.custom-form-step:visible');var step = $step.data('step');var nextStep = step + 1;if ( !that.$form.valid() ) return;var offset = findBootstrapEnvironment() != 'xs' ? menuScrollOffset : menuScrollOffset_mobile;var isScrollTopForm = that.$form.offset().top - offset < $(window).scrollTop();$step.hide();that.$form.find('.custom-form-step.step-' + nextStep).fadeIn(350);that.$previousButton.css('display','block');if ( nextStep >= that.totalSteps ) {that.$nextButton.hide();that.$submitButton.fadeIn(350);}
if ( that.$form.offset().top - offset < $(window).scrollTop() ) {$('html, body').stop().animate({scrollTop: (that.$form.offset().top - offset)}, 1250, 'easeInOutExpo');}});}
that.reset = function () {that.$form.find('.custom-form-step').hide();that.$previousButton.hide();that.$submitButton.hide();that.$form.find('.step-1').fadeIn(350);that.$nextButton.fadeIn(350);};}
S123.ButtonLoading = function() {var that = {};that.start = function($button) {if ( $button.find('.s123-btn-loading').length > 0 ) return;var html = $button.html();$button.html('
' + html + ''+S123.s123IconToSvg.getHtml('spinner','fa-spin white','')+'
');}
that.stop = function($button) {if ( $button.find('.s123-btn-loading').length == 0 ) return;$button.html($button.find('.s123-btn-loading-text').html());}
return that;}();function HomepageCountdown() {$( document ).on( 's123.page.ready', function( event ) {var $section = $('#top-section');var $countdown = $section.find('#homepageCountdown');var $container = $section.find('.homepage-countdown-container');if ( $countdown.length == 0 ) return;var countdownWidget = new CountdownWidget();countdownWidget.init({$countdown: $countdown,dateInfo: $countdown.data('date-info'),type: $countdown.data('type'),translate: {days: $countdown.data('days'),hours: $countdown.data('hours'),minutes: $countdown.data('minutes'),seconds: $countdown.data('seconds')},onStop: function() {$container.find('.message').fadeIn(350);}});});}
S123.CrossOriginHandler = function() {var _ = {};_.init = function() {if ( $('[data-rel="crossOriginHandler"]').length == 0 ) return;$(window).on('message.crossOriginHandler', function( event ) {var data = event.originalEvent.data;switch( data.eventType ) {case 'resize':$('#'+data.id).css({height: data.height});break;}});};return _;}();$.fn.popover.Constructor.prototype.reposition = function () {var $tip = this.tip();var autoPlace = true;var placement = typeof this.options.placement === 'function' ? this.options.placement.call(this, $tip[0], this.$element[0]) : this.options.placement;var pos = this.getPosition();var actualWidth = $tip[0].offsetWidth;var actualHeight = $tip[0].offsetHeight;if ( autoPlace ) {var orgPlacement = placement;var viewportDim = this.getPosition(this.$viewport);placement = placement === 'bottom' &&pos.bottom + actualHeight > viewportDim.bottom ? 'top' : placement === 'top' &&pos.top - actualHeight < viewportDim.top ? 'bottom' : placement === 'right' &&pos.right + actualWidth > viewportDim.width ? 'left' : placement === 'left' &&pos.left - actualWidth < viewportDim.left ? 'right' : placement
$tip.removeClass(orgPlacement).addClass(placement);}
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight);this.applyPlacement(calculatedOffset, placement);}
function IsEcommerceHighlight( moduleTypeNUM ) {return [157,158].indexOf(parseInt(moduleTypeNUM)) != -1;}
S123.scrollToHandler = function() {var _ = {};_.init = function() {$(document).one('s123.page.load.scrollTo', function( event ) {_.scroll();});$(document).on('s123.pjax.complete', function( event ) {initS123QueryString();_.scroll();});};_.scroll = function() {if ( !S123.QueryString.scrollTo ) return;if ( S123.QueryString.scrollTo.indexOf('section') != -1 ) {ScrollToModule('',S123.QueryString.scrollTo.replace('section-',''));}};return _;}();function youtube_parser( url ) {var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/;var match = url.match(regExp);return (match&&match[7].length==11)? match[7] : false;}
$.fn.s123ScrollParent = function( includeHidden ) {var position = this.css( "position" ),excludeStaticParent = position === "absolute",overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,scrollParent = this.parents().filter( function() {var parent = $( this );if ( excludeStaticParent && parent.css( "position" ) === "static" ) {return false;}
return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) +parent.css( "overflow-x" ) );} ).eq( 0 );return position === "fixed" || !scrollParent.length ?$( this[ 0 ].ownerDocument || document ) :scrollParent;};function S123Header_InitializeActionButtons( isTriggerPageReady = true ) {var $websiteHeaderSettings = $('#websiteHeaderSettings');if ( $websiteHeaderSettings.length == 0 ) return;var settings = tryParseJSON($websiteHeaderSettings.val());var btns = {mobile: {$el: $('#mainNavMobile .navActions'),list: ['phone','email','address','social','search','cart','wishList','clientZone'],},desktop: {$el: settings.headerLayout == '3' ? $('#websiteHeader #mainNav .navActions.pull-right') : $('#websiteHeader #mainNav .navActions'),list: ['address','social','search','cart','wishList','email','phone','clientZone','actionsButtons'],}};if ( settings.onepage == '2' ) {btns.mobile.list = btns.desktop.list;}
settings.isSideMenu = false;if ( settings.headerLayout == '5' || settings.headerLayout == '6' ) {settings.isSideMenu = true;delete btns.desktop;generateButtonsForSideMenu(settings);}
$.each(btns,function(type,data) {var html = '';if ( type == 'desktop' || settings.onepage == '2' ) {html += settings.languges;html += settings.multiCurrency;}
var btnsList = arrangeButtonsList(data.list,settings);$.each(btnsList,function( index, btn ) {html += getButtonHTML(btn,type,settings);});var $html = $(html);if ( type == 'mobile') {var $btns = $('
').append($html);var icons = $btns.find('.header-icon-wrapper').length;var btns = $btns.find('.header-btn-wrapper').length;icons = icons + $btns.find('.header-cart-wrapper').length;if ( settings.onepage == '2' && (btns > 1 || icons > 3 || (btns + icons) > 3) ) {var $landingPageBars = $('
'+S123.s123IconToSvg.getHtml('bars','','')+'');var $btns = $('
').append($html);var icons = $btns.find('.header-icon-wrapper').length;var btns = $btns.find('.header-btn-wrapper').length;var html = '';var actionBtnsHtml = '';html += '';html += '';var $html = $(html);$landingPageBars.find('.site-dropdown-menu').append($html);$html = $landingPageBars;$html.find('a.l-pagebars-btn').off('click').on('click',function(e) {e.preventDefault();e.stopPropagation();var $this = $(this);var $multiCurrencyBtn = $this.closest('.landingPageBars').find('a.multi-currencies-controller');$multiCurrencyBtn.find('span.m-c-symbol').remove();$multiCurrencyBtn.find('i').remove();$multiCurrencyBtn.on('click',function(e) {e.preventDefault();e.stopPropagation();});$this.closest('.landingPageBars').toggleClass('open');});} else {$html.each(function( index, li ) {if ( index < 2 ) return;$(li).hide();});}}
data.$el.html('').append($html);});ActivePopupActionButtonsInPage();if ( isTriggerPageReady ) TriggerS123PageReady();function generateButtonsForSideMenu( settings ) {var type = 'desktop';var html = '';var isFitMultiCurrencyBtn = false;html += '
';if ( settings.layoutID == '3' || settings.layoutID == '4' || settings.layoutID == '6' ) {html += settings.languges;html += settings.multiCurrency;isFitMultiCurrencyBtn = true;}
$.each(['cart','wishList','clientZone','actionsButtons'],function( index, btn ) {if ( settings.btns[btn].isActive || btn == 'cart' ) {html += getButtonHTML(btn,type,settings);}});html += '
';html += '';html += '';var $html = $(html);if ( isFitMultiCurrencyBtn ) {$html.find('.header-m-c-wrapper').addClass('m-c-width-auto');}
$('#header .header-column-menu-actions .header-nav').html('').append($html);}
function arrangeButtonsList( list, settings ) {var newBtnList = [];$websiteHeaderSettings.data('arranged-icons',!$.isEmptyObject(settings.headerCallToActionsButtons));$.each(settings.headerCallToActionsButtons,function( btn ) {if ( list.includes(btn) && (settings.btns[btn].isActive || btn == 'cart') ) {newBtnList.push(btn);}});$.each(list,function( index, btn ) {if ( !newBtnList.includes(btn) && (settings.btns[btn].isActive || btn == 'cart') ) {newBtnList.push(btn);}});return newBtnList;}
function getButtonHTML( btn, type, settings ) {var html = '';switch ( btn ) {case 'email':html += '';break;case 'address':html += '';break;case 'social':html += '';break;case 'search':html += '';break;case 'wishList':html += '
';html += '' + S123.s123IconToSvg.getHtml('heart','','') + '';html += '';break;case 'clientZone':html += '
';html += '' + S123.s123IconToSvg.getHtml('user','','') + '';html += '';break;case 'cart':if ( settings.isSideMenu ) {html += '
' + settings.btns[btn].showMenuActionButtons + '
';} else {html += '
' + settings.btns[btn].showMenuActionButtons + '';}
break;case 'phone':if ( type == 'mobile' ) {html += '';} else {html += '';}
break;case 'actionsButtons':if ( settings.btns[btn].button1.isActive ) {html += '';}
if ( settings.btns[btn].button2.isActive ) {html += '';}
break;}
return html;}}
S123.ElementSizeChangeManager = function() {var _ = {observing: {}};_.escm_init = function() {_.SizeChangeManager = new ResizeObserver(function( entries ) {for ( let entry of entries ) {const elSettings = getObservedSettings(entry.target.id);if ( !elSettings ) continue;if ( !isObservedSizeChaged(elSettings,entry) ) continue;elSettings.$el.trigger('escm.size.changed');}});};_.escm_observe = function( id, changesToObserve ) {const $element = $(`#${id}`);if ( $element.length == 0 ) return;if ( $element.hasClass('escm-observing') ) {_.escm_unobserve(id);}
_.SizeChangeManager.observe($element.get(0));$element.addClass('escm-observing');_.observing[id] = {id: id,$el: $element,changesToObserve: changesToObserve};if ( changesToObserve.includes('width') ) {_.observing[id].lastWidth = $element.outerWidth();}
if ( changesToObserve.includes('height') ) {_.observing[id].lastHeight = $element.outerHeight();}};_.escm_unobserve = function( id ) {const $element = $(`#${id}`);_.SizeChangeManager.unobserve($element.get(0));$element.removeClass('escm-observing');delete _.observing[id];};function getObservedSettings( id ) {return _.observing[id];}
function isObservedSizeChaged( elSettings, entry ) {if ( elSettings.changesToObserve.includes('width') && elSettings.lastWidth != entry.contentRect.width ) {elSettings.lastWidth = entry.contentRect.width;return true;}
if ( elSettings.changesToObserve.includes('height') && elSettings.lastHeight != entry.contentRect.height ) {elSettings.lastHeight = entry.contentRect.height;return true;}
return false;}
return _;}();var site123FixText = function() {var _ = {};_.fixText = function( $textEle, $parentBox, compressor ) {const fontSize = parseInt($textEle.css('font-size'),10);let fixText = {isFitText: false,minFontSize: fontSize,maxFontSize: fontSize};if ( $textEle.width() >= $parentBox.width() ) {let widthRatio = $textEle.width() / $parentBox.width();fixText.maxFontSize = fontSize / widthRatio;fixText.minFontSize = fixText.maxFontSize - compressor;fixText.isFitText = true;}
return fixText;}
_.getMaxFontSize = function( $textEle, $parentBox, compressor ) {let maxFontSizeArr = [];let isfitText = false;$textEle.each(function() {const fitText = _.fixText($(this),$parentBox,compressor);maxFontSizeArr.push(fitText.minFontSize);isfitText = fitText.isFitText ? fitText.isFitText : isfitText;});return {isfitText : isfitText,maxFontSize: Math.min(...maxFontSizeArr)};}
_.itemFixText = function( $textEle, $parentBox, compressor ) {$textEle.css('visibility','hidden');if ( $textEle.length > 1 ) {const fitText_max = _.getMaxFontSize($textEle,$parentBox,compressor);if ( fitText_max.isfitText ) $textEle.css('font-size',fitText_max.maxFontSize + 'px');} else {const fitText = _.fixText($textEle,$parentBox,compressor);if ( fitText.isFitText ) $textEle.css('font-size',fitText.minFontSize + 'px');}
$textEle.css('visibility','visible');}
return _;}();S123.preventImgVideoBrowserRightClick = function () {var _ = {};_.init = function() {if ( IsWizard() ) return;$(document).on( 's123.page.ready', function( event ) {_.preventRightClick($);});}
_.preventRightClick = function( jQueryObj ) {jQueryObj('img, video').off('contextmenu').on('contextmenu', function( e ) {let $this = jQueryObj(this);var src = this.tagName.toLowerCase() === 'img' ? $this.attr('src') : $this.find('source').attr('src');if ( src && src.indexOf('_gi-') !== -1 ) {e.preventDefault();}});}
return _;}();